package com.wp;

import com.wp.service.BookShopService;
import com.wp.service.ShoppingCarService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.ArrayList;
import java.util.List;

/**
 * @author: WangPeng
 * @createTime: 2022/11/14 17:56
 * @description:
 * @version: v1.0
 */
public class Test01 {
    public static void main(String[] args) {
        ApplicationContext app = new ClassPathXmlApplicationContext("spring.xml");
        BookShopService bookShopService = app.getBean(BookShopService.class);
//        bookShopService.buyBook("1002","汪鹏");
        List<String> list = new ArrayList<>();
        list.add("1001");
        list.add("1002");
//        bookShopService.buyManyBook(list,"汪鹏");
        ShoppingCarService shoppingCarService= app.getBean(ShoppingCarService.class);
        shoppingCarService.buyManyBook(list,"汪鹏");
    }
}
